﻿using System.Linq;

namespace MartinRL.ProjectEuler
{
    public class APowerBDistinctCalculation
    {
        public readonly int Result;

        public APowerBDistinctCalculation(int from, int to)
        {
            Result = from.To(to)
                    .SelectMany(a => from.To(to)
                                        .Select(b => a.BigPow(b)))
                    .Distinct()
                    .Count();
        }
    }
}